import java.util.Scanner;

public class CalendarSeeker {
    enum Month {january, february, march, april, may, june, july, august, september, october, november, december}
    enum Days {Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday}

    public static int dayFindLogic (Integer currentday, int currentyear, int currentmonth) {
        return (7000 + currentday + currentyear + (currentyear / 4) - (currentyear / 100) + (currentyear / 400) + (31 * currentmonth) / 12) % 7;
    }

    public static String getDay ( String inputedDay, int inputedMonth, String inputedYear) {
        int a = (14 - inputedMonth) / 12;
        int m = Integer.valueOf(inputedYear) - a;
        int d = dayFindLogic(Integer.valueOf(inputedDay), m, inputedMonth + 12 * a - 2);
        return Days.values()[d].toString();
    }

    public static void main (String args[]) {
        System.out.println("Please, input the date in format 'dd <month> yyyy' example '08 may 2013'");
        Scanner input = new Scanner(System.in);
        String[] targetDate = input.nextLine().toLowerCase().split(" ");
        input.close();
        int inputmonth = Month.valueOf(targetDate[1]).ordinal() + 1;
        System.out.println(" this is " + getDay(targetDate[0], inputmonth, targetDate[2]));
    }
}